<?php

if ((!defined('NV_SYSTEM')) AND (!defined('NV_ADMIN'))) {
    Header("Location: ../index.php");
    exit;
}

/*Ph?n khai báo*/
$chude = 1; //Ch?n ch? d? mà b?n mu?n tin hi?n m?i nh?t hi?n ra
$limit = 1; //Bao nhiêu b?n tin s? hi?n ra
$hthometext = 1;//Hi?n th? ph?n l?i nói d?u c?a bài vi?t hay không. 0 - không, 1 - d?ng ý
$sizeximg = 50;//Ð? dài chi?u ngang c?a hình ?nh minh h?a
$Scroll = 0;//Có cho n?i dung c?a block ch?y t? du?i lên trên hay không. 0 - không, 1 - d?ng ý
$path = "uploads/Story/pic"; //Noi ch?a thu vi?n hình ?nh cho bài vi?t
/*H?t ph?n khai báo*/

global $prefix, $multilingual, $currentlang, $db, $themepath; 
if ($multilingual == 1) { 
$querylang = "AND (alanguage='$currentlang' OR alanguage='')"; 
} else { 
$querylang = ""; 
} 

$content = "<table width=\"100%\" border=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td>";
if ($Scroll) {
   $content .= "<marquee behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"150\" scrollamount= \"2\" scrolldelay= \"100\" onmouseover='this.stop()' onmouseout='this.start()'>"; 
}
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" width=\"100%\" cellpadding=\"5\">"; 
$sql = "SELECT id, title, hometext, images FROM ".$prefix."_truyen WHERE cid='$chude' ORDER BY id DESC LIMIT 0,$limit"; 
$result = $db->sql_query($sql); 
while ($row = $db->sql_fetchrow($result)) { 
$sid = $row['id']; 
$title = $row[title]; 
$hometext = $row[hometext];
$img = $row[images];
if ($img != "") {
   $story_img = "<a href=\"".INCLUDE_PATH."modules.php?name=Story&td=view_article&id=$sid\"><img border=\"0\" src=\"".INCLUDE_PATH."$path/$img\"  width=\"$sizeximg\" style=\"float: right\"></a>";
}
else {
   $story_img = "";
}
if ($hthometext) {
   $content .= "<tr><td valign=\"top\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\">$story_img<b><a href=\"".INCLUDE_PATH."modules.php?name=Story&td=view_article&id=$sid\">$title</a></b><br>$hometext</td></tr>";
}
else {
   $content .= "<tr><td valign=\"top\" style=\"border-left-width: 1px; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px\">$story_img<b><a href=\"".INCLUDE_PATH."modules.php?name=Story&td=view_article&id=$sid\">$title</a></b></td></tr>";
}
} 

$content .= "</td><tr></table>"; 
if ($Scroll) {
   $content .= "</marquee>";
}
//$content .= "</td><tr><td><center>[<b><a href=\"".INCLUDE_PATH."modules.php?name=Story&td=view_article&catid=$chude\">Bản Tin Khác ...</a></b>]</center></td></tr></table>"; 
$content .= "</td></tr></table>"; 

?> 

